//
// Created by 32827 on 2024/5/19.
//
#include "view/yzl_ui_view_pp_demo.hpp"

#include "view/yzl_ui_view_pp_1306_demo.hpp"


ViewDemo1306::ViewDemo1306(YZL_VIEW *viewRam) : ViewBase(viewRam) {
    mLayoutVertical = new LayoutVertical(this);
    mLayoutVertical->setRange(0,0,128,64,3);
    mLayoutVertical->setMargin(2);
}

ViewDemo1306::~ViewDemo1306(){
    delete mLayoutVertical;
    ViewBase::~ViewBase();
}

YZF_BOOL ViewDemo1306::initP(void *initStructPointer, void *actStructPointer) {
    ViewBase::initP(initStructPointer, actStructPointer);

    mText1=new WidgetText((*this)[-1],mLayoutVertical->nextRect(),0,
                          (utf8 *) "文本123哈哈");
    addChild(mText1);
    return YZF_TRUE;
}

void ViewDemo1306::wakeupP(void *actStructPointer) {
    ViewBase::wakeupP(actStructPointer);
}

char *ViewDemo1306::getViewName() {
    return "ViewDemo1306";
}

int ViewDemo1306::getViewId() {
    return 2;
}

void ViewDemo1306::drawP(void *drawStructPointer) {
    yzl_ui_draw_rect( mText1->instance->x,mText1->instance->y, mText1->instance->width-1, mText1->instance->height-1,YZF_FALSE,WHITE);
    ViewBase::drawP(drawStructPointer);
}

